<?php

/**
 * Abstract Sql Model class
 * @author greenogre <ogre.green@gmail.com>
 * @since 17.05.2012
 * @copyright 2012. greenogre
 * @licence LGPL
 */
abstract class Green_Sql_ModelAbstract extends Green_ModelAbstract {

    /**
     * @var Zend_Db_Adapter_Abstract
     */
    protected $_adapter;

    /**
     * @var Zend_Db_Select
     */
    protected $_listSelect;


    /**
     * @param Zend_Db_Adapter_Abstract $adapter
     */
    public function __construct(Zend_Db_Adapter_Abstract $adapter) {
        $this->_adapter = $adapter;
        $this->_listSelect = $this->_adapter->select();
    }

    /**
     * reset method modified for sql models
     */
    protected function _reset() {
        parent::_reset();
        $this->_listSelect = $this->_adapter->select();
    }
}